/**
 * 
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 * 
 *   http://www.apache.org/licenses/LICENSE-2.0
 *   
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 * 
 */
package org.jiopi.ibean.example.module.helloworld;

import org.jiopi.ibean.example.blueprint.helloworld.HelloWorld;
import org.jiopi.ibean.example.blueprint.helloworld.IBean;

/**
 * 
 * HelloWorld实现类
 * 
 * 
 * v0.2: 增加 public void setMsg(String msg);方法演示Spring装配
 * 
 * @version 0.2 2010.4.27
 * @since iBean0.1 2010.4.27
 */
public class HelloWorldImpl implements HelloWorld {
	
	private String msg;
	
	public HelloWorldImpl(){
		msg="Hello World";
	}
	
	public HelloWorldImpl(String addMsg){
		msg="Hello World "+addMsg;
	}

	public String getHelloWorld() {
		return msg;
	}

	public void helloWorld() {
		System.out.println(msg);
	}
	
	public void setMsg(String msg){
		this.msg = "Hello World "+msg;
	}

	public IBean helloWorld(IBean iBean) {
		IBeanImpl iBeanImpl = (IBeanImpl)iBean;
		System.out.println("me:"+this.msg+" iBean:"+iBeanImpl.msg);
		IBeanImpl newIBeanImpl = new IBeanImpl();
		newIBeanImpl.msg = "I have say hello with HellWorld";
		return newIBeanImpl;
	}

}
